package ar.pmt.vista.acciones;

import java.util.HashMap;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.actions.LookupDispatchAction;

/**
 * Carga de horas diarias. Se encarga de la carga inicial, consulta y
 * confirmacion de la carga de horas diarias.
 */

public class CargaHorasDiariasDispatch extends LookupDispatchAction {

	
	/**
	 * mapeo de los botones
	 * @return un map con boton, accion
	 */
	@SuppressWarnings("unchecked")
	@Override
	protected Map getKeyMethodMap() {
		Map map = new HashMap();
		map.put("pmt.boton.consultar", "consultar");
		map.put("pmt.boton.confirmar", "confirmar");
		return map;
	}

	/**
	 * Llama  a consultar
     * @param mapping ActionMapping
     * @param form Formulario
     * @param request Request
     * @param response Response
     * @return ActionForward
     * @throws Exception Lanza las excepciones no controladas. 
     */
	public ActionForward consultar(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response) throws Exception {
		
		return mapping.findForward("consultar");
	}

	/**
	 * Llama  a confirmar
     * @param mapping ActionMapping
     * @param form Formulario
     * @param request Request
     * @param response Response
     * @return ActionForward
     * @throws Exception Lanza las excepciones no controladas. 
     */
	public ActionForward confirmar(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response) throws Exception {	
		
		return mapping.findForward("confirmar");
	}

}
